ResEdit is a stand-alone application for editing resources.
ResEdit is an interactive, graphically based application for manipulating the various resources in a Macintosh application. It lets you create and edit all standard resource types except 'CODE', and copy and paste all resource types (including 'CODE'). ResEdit actually includes a number of different resource editors: There is a general resource editor, for editing any resource in hex and ASCII format, and there are several individual resource editors for specific types of resources. You can also create your own resource editors to use with ResEdit.
USES OF RESEDIT
ResEdit is especially useful for creating and changing graphic resources such as dialog boxes and icons. For example, you can use ResEdit to put together a quick prototype of a user interface and try out different formats and presentations of resources. Anyone can quickly learn to use ResEdit for translating resources into a foreign language without having to recompile the program. You can use ResEdit to modify a
programΓÇÖs resources at any stage in the process of program development.
From the Finder, you can just select and open the ResEdit icon. ResEdit displays a window that lists the files and folders for each disk volume currently mounted.
WORKING WITH FILES
To list the resource types in a file, select and open the filename from the list. (You can select a name by clicking on it or by typing one or more characters of the name.)
When a directory window is the active window, the File menu commands act as follows:
ΓÇó New
Creates a new file.
ΓÇó Open
Opens the selected file or folder (this is the same as
double-clicking on the name).
ΓÇó Close
Closes the volume window (this is the same as
clicking the close box). If itΓÇÖs a 3.5-inch disk, the
disk is ejected.
ΓÇó Get Info
Displays file information and allows you to change
it.
ΓÇó Transfer
Allows you to transfer to an application other than
the application that launched ResEdit. (This is an
alternative to the Quit command.)
ΓÇó Quit
Quits from ResEdit and returns to the Finder.
ResEdit will recognize a new disk when itΓÇÖs inserted, and handle multiple drives. Note that you can also use ResEdit to copy or delete files:
ΓÇó Deleting Files
To delete a file, select the file and choose Clear from
the Edit menu.
ΓÇó Copying Files
To copy a resource file, you must select all of its
resources and copy them.
ΓÇó Pasting Files
Then paste them into a new file. (File attributes are
not automatically copied by this operationΓÇöyou
must set them via the Get Info command.)
NOTE!! ResEdit cannot copy a data fork.
WORKING WITHIN A FILE
When you open a file, a window displays a list of all the resource types in that file. While this window is the active window, you can create new resources, copy or delete existing resources, and paste resources from other files.
NOTE! The resources are displayed by a resource picker. The general resource picker displays the resources by type, name, and ID number; there are also special resource pickers for some resource types
(for example, the 'ICON) resource picker displays the icons graphically).
A RESEDIT FILE WINDOW
When a file window is the active window, the File menu commands have the following effects:
ΓÇó New
Creates a new resource in the open file.
ΓÇó Open
Opens a window displaying all resources of the
resource type selected. (Select the resource type by
clicking on it or by typing its first character.)
NOTE! If you hold down the Option key while opening a resource type, the resource window will open with the general resource picker.
ΓÇó Open General
Opens the general resource picker.
ΓÇó Close
Closes the file window and asks if you want to save
the changes you have made.
NOTE! If youΓÇÖve made changes, you should not reboot before closing.
ΓÇó Revert
Changes the resource file back to the version that
was last saved to disk.
ΓÇó Quit
Quits from ResEdit.
When a file window is the active window, the Edit menu commands have the following effects:
ΓÇó Cut
Removes all resources of the resource types
selected, placing them in the ResEdit scrap.
ΓÇó Copy
Copies all resources of the resource types selected
into the ResEdit scrap
ΓÇó Paste
Copies the resources from the ResEdit scrap into
the file windowΓÇÖs resource type list.
ΓÇó Clear
Removes all resources of the resource type selected,
without placing them in the ResEdit scrap.
ΓÇó Duplicate
Creates duplicates of all resources of the resource
types selected, and assigns a unique resource ID
number to each new resource.
WORKING WITHIN A RESOURCE TYPE
Opening a resource type produces a window that lists each resource of that type in the file. This list will take different forms, depending on the particular resource picker; if you hold down the Option key during the open, the general resource picker is invoked.
A RESOURCE TYPE WINDOW
When a resource type window is the active window, the File menu commands have the following effects:
ΓÇó New
Creates a new resource and opens its editor.
ΓÇó Open
Opens the appropriate editor for the resource you
selected.
ΓÇó Open a
Allows you to open an editor template of a different
type.
ΓÇó Open General
Opens the general (hex) resource editor.
ΓÇó Close
Closes the resource type window.
ΓÇó Revert
Changes the file back to what it was before you
opened the resource type window.
ΓÇó Get Info
Displays resource information and allows you to
change it.
A GET INFO WINDOW FOR ICN#'s
When a resource type window is the active window, the Edit menu commands have the following effects:
ΓÇó Undo
Undoes the most recent editing command. Undo may
or may not be selectable, depending on the specific
editor in use.
ΓÇó Cut
Removes the resources that are selected, placing
them in the ResEdit scrap.
ΓÇó Copy
Copies all the resources that are selected into the
ResEdit scrap.
ΓÇó Paste
Copies the resources from the ResEdit scrap into
the resource type window.
ΓÇó Clear
Removes the resources that are selected, without
placing them in the ResEdit scrap.
ΓÇó Duplicate
Creates a duplicate of the selected resources and
assigns a unique resource ID number to each new
resource.
EDITING INDIVIDUAL RESOURCES
To open an editor for a particular resource, either double-click on the resource or select it and choose Open from the File menu. One or more auxiliary menus may appear, depending on the type of resource youΓÇÖre editing. Some editors, such as the 'DITL' editor, allow you to open additional editors for the elements within the resource. All the editors use File and Edit menus similar to those described above, but operate on individual resources or individual elements of a resource, and hence vary in their appearance and function as explained below.
If you hold down the Option key while opening a resource, the general data editor is invoked. This editor allows you to edit the resource as hexadecimal or ASCII data. If you hold down the Shift and the Option keys while opening, ResEdit shows you a list of all editors and templates.
CAUTION
Individual editors may not be appropriate for all resource typesΓÇöinappropriate editors may cause system errors to occur.
The menus for some of the editors are discussed below. The use of the editors not discussed here should be apparent when you run them.
NOTE! The general data editor will not edit resources larger than 16K bytes; however, you can move larger resources with the Cut, Copy, Paste, and Clear
commands as described above.
'CURS' (cursor) RESOURCES
For 'CURS' resources, the editor displays three images of the cursor. You can manipulate all three images with the mouse.
EDITING 'CURS' RESOURCES
The Cursor menu contains the following commands:
ΓÇó Try Cursor
Lets you try out the cursor by having it become the
cursor in use. (Restore Arrow restores the
standard arrow cursor.)
ΓÇó Data ΓÇô>Mask
Copies the cursor image to the mask editing area.
ΓÇó 'DLOG' (dialog template) resources
For 'DLOG' resources, the editor displays a miniture image of the dialog in the editor window. The dialog can be resized by clicking just within its border and dragging.
The 'DLOG' menu consists of a single item "Display as Text." If this item is selected, the graphical display of the dialog is replaced with a "text" representation of it. It is here that you can specify a name that will appear in the dialog's title bar. Here also you specify the procID of the dialog, which describes the window type of the dialog. The visible and goAwayFlag checkboxes MUST BE UNCHECKED for use with ShowDialog XCMD.
The itemsID contains a number matching the DITL resource containing the items of the dialog. You can specify the size of the DLOG here too.
ΓÇó 'DITL' (dialog item list) resources
For 'DITL' resources, the editor displays an image of the item list as your program would display it in a dialog or alert box. When you select an item, a size box appears in the lower-right corner of its enclosing rectangle so that you can change the size of the rectangle. You can move an item by dragging it with the mouse.
Note that the DITL editor has a "grow" box in the lower right corner of its window. Resizing the window with the "grow" box DOES NOT resize the resulting dialog window. You must set the size of the dialog in the DLOG editor (see above).
If you open an item within the dialog box, the editor associated with the item is invoked; for an 'ICON', for example, the icon editor is invoked. If you hold down the Option key while opening, the general data editor is invoked.
The DITL menu contains the following commands:
ΓÇó Bring to Front
Allows you to change the order of items in the item
list. Bring to Front causes the selected item to
become the last (highest numbered) item in the list.
The actual number of the item is shown by the '
DITM' editor.
ΓÇó Send to Back
Like Bring to Front, except that it makes the
selected item the first item in the listΓÇöthat is, item
number 1.
ΓÇó Grid
Aligns the item on an invisible 8-pixel by 8-pixel
grid. If you change the item location while Grid is
on, the location will be adjusted such that the upper-
left corner lies on the nearest grid point above and
to the left of the location you gave it. If you change
the size, it will be made a multiple of 8 pixels in
both dimensions.
ΓÇó Use RSRC Rect
Restores the enclosing rectangle to the rectangle
size stored in the underlying resource. Note that
this works on 'ICON', 'PICT', and 'CNTL' items only;
the other items have no underlying resources.
ΓÇó Use Full Window
Adjusts the window size so that all items in the item
list are visible in the window.
'FONT' RESOURCES
For 'FONT' resources, the editor window is divided into three panels: a character editing panel, a sample text panel, a character selection panel, and a set of MacDraw-like graphics tools.
'FONT' EDITOR WINDOW
The character editing panel on the left side of the window shows an enlargement of the selected character. You can edit it, as with FatBits in MacPaint, by clicking bits on and off. Click and drag the black triangles at the bottom of the character editing panel to set the left and right bounds (that is, the character width). The three triangles at the left of the panel control the ascent, baseline, and descent.
The sample text panel, at the upper right, displays a sample of text in the font currently being edited. (You can change this text by clicking in the text panel and using normal Macintosh editing techniques.)
The character selection panel is below the text panel. You can select a character to edit by typing it (using the Shift and Option keys if necessary), or by clicking on it in the row of three characters shown. (Click on the right character in the row to move upward through the ASCII range; click on the left character to move downward.) The character you select is boxed in the center of the row with its ASCII value shown below it (in decimal).
The graphic tools panel, directly below the character selection panel, offers a dozen or more of the familiar MacDraw-type tools including the hand mover, pencil, eraser, circles and rectangles. In addition, a selection of colors is available.
CAUTION
Changing the ascent or descent of a character changes the ascent or descent for the entire font.
Any changes you make in the character editing panel are reflected in the text panel and the character selection panel. Remember that you cannot save the changes until you close the file.
You can also change the name of a font. The font name is stored as the name of the resource of that font family with size 0. This resource does not show up in the normal display of all fonts in a file. To display it, hold down the Option key while you open the 'FONT ' type from the file window. You will see a generic list of fonts. Select the font with the name you wish to change, and choose Get Info.
The following is a step-by-step guide for the first-time ResEdit user for making a simple ShowDialog DLOG/DITL template.
Remember, use ResEdit on a copy of a file only!!!
1. Launch ResEdit. You'll see one small window for each mounted disk. The files/folders will be listed in the windows. Double-click on a line to open a file. If the line is a folder, double-clicking on it will open a new window with its contents listed.
2. If the file has no resources, opening the file with ResEdit will create a resource fork. If the file already has resources, when you open the file, you'll see listed the TYPES of resources in the file.
3. If you DO NOT see "DLOG" listed, it means your file currently has no DLOG resources in it. Choose "New" from the File menu. You'll see a dialog with a scrolling list of all the TYPES of resources that ResEdit can make. Scroll until you see "DLOG" (or enter DLOG into the edit box). Click OK. This will open a new, empty window.
4. Again, select "New" from the File menu. This time, ResEdit will create a new DLOG resource for you. It will randomly assign a resource ID to it (ResEdit will NEVER duplicate ID numbers for any given resource type). You'll be looking at the DLOG editor, which presents a tiny picture of the new dialog on a tiny Mac screen. You can move the dialog around, and resize it
(à la MacDraw) by dragging it.
5. You'll see one new menu: "DLOG." It has only one menu item: "Display as text." Select this item. The tiny picture of the dialog will be replaced by a window that contains information about the ATTRIBUTES of the dialog. In this window, you can type in exact dimensions for the dialog. BE SURE to UNCHECK the
"visible" and "goAwayflag" boxes. THIS IS VERY INPORTANT! The ONLY other thing you need to worry about is the procID box. The procID describes how the dialog "looks." The procID for a "standard" dialog box is 1. ResEdit assigns a default procID of 0, so you'll have to change it. When you're done, select the one menu item (now called "Display Graphically") from the "DLOG" menu. You'll be returned to the tiny picture of the dialog.
6. The DLOG resource ONLY describes the size and border of the dialog. It says NOTHING about its contents. Double-click on the tiny picture of the dialog. This will create a DITL resource AND LINK it to the DLOG resource.
7. You'll now be looking at the DITL editor. This window will initially be empty. There will be a grow box in the lower, right corner. Resizing the window with the grow box DOES NOT resize the dialog. YOU HAVE TO DO THIS IN THE DLOG RESOURCE. Select
"New" from the "File" menu. This will create a new DITL item#. It will be item #1. You will see a dialog box describing the attributes of the new DITL item. From within this dialog you can set the "rect" of the item, and its type, and whether it is ENABLED or DISABLED. A good rule of thumb is that items that the user will INTERACT with should be ENABLED. Otherwise they should be made DISABLED.
8. If you make your DITL item a Button, Check Box, or Radio Button, type the name of the button into the edit box. If your item is Static Text, type the contents of the text into the edit box. If your item is an icon, type the ICON resource ID into the edit box. The same goes for a PICT. When you're done, click the goAway box.
9. You'll see your new item in the DITL window. You can move it around and resize it à la MacDraw. If your item is an icon or a PICT you'll notice that it probably looks pretty strange. In that case, from the "DITL" menu, select "Use RSRC Rectangle." The will cause the new item to assume the dimensions of the icon or PICT. If the item is NOT an icon or PICT, double-clicking on it will reopen its attributes box. If it IS an icon or PICT, you'll have to hold down the command-option keys when double-clicking on it. If you don't do this, then, in the case of an icon, you'll open the ICON editor for that particulat ICON resource. This is a FatBits type editor. In the case of a PICT, you'll see the PICT resource described in Hex. (You can't do anything with it.) You create PICT resources by closing down all the opened DLOG and DITL windows and selecting
"New" from the "File" menu. You'll see the resource type dialog again. Scroll until you see "PICT" (or type "PICT" into the box). You'll see a new, empty window. Paste in your graphic from the clipboard or scrapbook.
10. Add your DITL items one after the other to build your template. Each new DITL item is numbered one higher than the previous. If you "Cut" a lower numbered DITL item, all the higher numbered ones are decremented by one. Checking the "DITL" menu item "Align to Grid," will make aligning your DITL items easier.
11. When your template is finished, the last thing you need to do is make all resources purgeable. This means that the memory that they consume can be reclaimed by the Memory Manager, if required. Close down all open resource windows (but don't close the file, itself). Select the line in the DLOG window that corresponds to the new DLOG (it will say something like "DLOG ID = xxx." From the "File" menu, select
"Get Info." You'll see a new window. Check the box marked "Purgeable." Leave all other boxes unchecked. If you want, you can name the resource here. You can renumber it too. Do this for ALL resources that you have made (DLOG, DITL, PICT, ICON, etc.).
12. One trick about renumbering DITL resources: The DITL is linked to a particular DLOG in the DLOG's attributes window (the one you got by selecting
"Display as text." If you change the ID number of a DITL resource "after the fact," you'll have to go into the DLOG attributes window to enter in the new number (Otherwise your new dialog will appear to be
"empty," because the DLOG and DITL have become
"unlinked."). It's good form to have a linked DLOG and DITL share the same resource number. (Remember, ID's are not duplicated WITHIN a resource type; but different resource TYPES can have identical ID numbers.)
13. Close all windows and save. You've just created your first dialog with ResEdit!
-- part contents for background part 18
----- text -----
GETTING FAMILIAR WITH RESEDIT
It is a good idea to obtain the proper documentation and the latest version of ResEdit if you are going to be making your own resource items for use with ShowDialog.
SEE: OBTAINING RESEDIT
WARNING!!
You can edit any file shown in the window, including the System file and ResEdit itself. However, itΓÇÖs dangerous to edit a file thatΓÇÖs currently in use. Edit a copy of the file instead. (For example, edit the System file on a non boot volume.)
CAUTION!
Individual editors may not be appropriate for all resource typesΓÇöinappropriate editors may cause system errors to occur.
-- part contents for background part 31
----- text -----
Be sure to always use the most current version of ResEdit (1.2b3 as of March 1989).
ResEdit can be obtained from the major on-line services or from most user groups.
Sources for ResEdit:
CompuServe:
AppDev Forum; Data Library 8 (From Apple [Mac]): RESED.APP
GEnie:
Macintosh Developers RT: file # 1200
(RESEDIT 1.2B2.SIT)
BMUG (formally the Berkeley Macintosh User's Group)